<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function f() {
            var form = document.getElementsByTagName("form");
            form[0].action="www.baidu.com";
            form[0].method="post";
            form[0].innerHTML="<input type='hidden' name='uid' value='570272838' />"+form[0].innerHTML;
            form[0].innerHTML+="<input type='submit' /><input type='reset' />"
        }
    </script>
</head>
<body onload="f()">
<form>
    用户名: <input type="text" name="username"/>
    <br/>
    密码: <input type="password" name="pwd"/>
    <br/>
    确认密码: <input type="password" name="repwd"/>
    <br/>
    性别: <input type="radio" name="sex" value="man" checked="checked"/>男
    <input type="radio" name="sex" value="woman"/>女
    <br/>
    爱好: <input type="checkbox" name="hobby" value="code" checked="checked"/>编程
    <input type="checkbox" name="hobby" value="run"/>跑步
    <input type="checkbox" name="hobby" value="swim" />游泳
    <br/>
    幸运颜色: <input type="checkbox" name="luckyColor" value="red"/>红
    <input type="checkbox" name="luckyColor" value="blue"/>蓝
    <input type="checkbox" name="luckyColor" value="yellow"/>黄
    <br/>
</form>
</body>
</html>